package com.common.baselibrary.mvp;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.TextView;

import com.common.baselibrary.R;

import androidx.annotation.NonNull;


public class LoadingDialog extends Dialog {

    private TextView tvContent;

    private LoadingDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    public void setText(String text) {
//        if (tvContent == null)
//            tvContent = getWindow().findViewById(R.id.tvContent);
//        tvContent.setText(text);
    }

    public static class Builder {
        private Context context;
        LoadingDialog dialog;

        public Builder(Context context) {
            this.context = context;
        }

        public LoadingDialog build() {
            dialog = new LoadingDialog(context, R.style.LoadingDialog);
//            dialog.setContentView(R.layout.layout_loading_dialog);
            return dialog;
        }

        public void show() {
            build().show();
        }
    }
}
